#pragma once
#include "IInputBinding.h"
#include "../RawInput/RawInput.h"
#include "../RawInput/CustomHidController.h"

namespace TLAC::Input
{
	class RawInputCustomHidControllerBinding : public IInputBinding
	{
	public:
		RawInputCustomHidControllerBinding(RawInputCustomHidController::ButtonIndex button_index);

		bool IsDown() override;
		bool IsTapped() override;
		bool IsReleased() override;

		static RawInputCustomHidControllerBinding* NewTriangleBinding()
		{
			return new RawInputCustomHidControllerBinding(RawInputCustomHidController::ButtonIndex::Triangle);
		}
		static RawInputCustomHidControllerBinding* NewSquareBinding()
		{
			return new RawInputCustomHidControllerBinding(RawInputCustomHidController::ButtonIndex::Square);
		}
		static RawInputCustomHidControllerBinding* NewCrossBinding()
		{
			return new RawInputCustomHidControllerBinding(RawInputCustomHidController::ButtonIndex::Cross);
		}
		static RawInputCustomHidControllerBinding* NewCircleBinding()
		{
			return new RawInputCustomHidControllerBinding(RawInputCustomHidController::ButtonIndex::Circle);
		}
		static RawInputCustomHidControllerBinding* NewStartBinding()
		{
			return new RawInputCustomHidControllerBinding(RawInputCustomHidController::ButtonIndex::Start);
		}
		static RawInputCustomHidControllerBinding* NewTestBinding()
		{
			return new RawInputCustomHidControllerBinding(RawInputCustomHidController::ButtonIndex::Test);
		}
		static RawInputCustomHidControllerBinding* NewServiceBinding()
		{
			return new RawInputCustomHidControllerBinding(RawInputCustomHidController::ButtonIndex::Service);
		}

	private:
		const int button_index_;
		const RawInputCustomHidController::CustomHidControllerHandler& handler_;
	};
}